import {Module} from '@nestjs/common'
import {APP_PIPE} from '@nestjs/core'
import {AppController} from './app.controller'
import {CatController} from "./cat.controller";
import {UserController} from './user.controller'
import {CustomProviderInjectPipe} from "./customPipes/custom-provider.inject.pipe";

@Module({
    controllers: [
        AppController,
        CatController,
        UserController
    ],
    imports: [],
    providers: [
        {
            provide: 'customPipeInject',
            useValue: 'provide-value'
        },
        {
            provide: APP_PIPE,          //该方式的全局管道可以使用providers注入，app.useGlobalPipes无法使用
            useClass: CustomProviderInjectPipe,
        }
    ]
})
export class AppModule {
}
